package com.dzm;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * 作者：Dzm
 * 时间：2024-08-21-15:35
 * 功能：
 */

@EnableFeignClients
@SpringBootApplication
public class EmpServer {
    public static void main(String[] args) {
        SpringApplication.run(EmpServer.class, args);
    }

    @Bean
    @LoadBalanced   //此注解要配合loadBalanced依赖才起作用
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
